﻿CREATE PROCEDURE [dbo].[AddSecurityRoleAccess]
	@SecurityRoleAccessId uniqueidentifier,
	@Role uniqueidentifier,
	@SecurityRole uniqueidentifier,
    @Permissions int,
	@CreatedBy uniqueidentifier,
	@CreatedOn datetime,
    @LastChanged datetime,
	@LastChangedBy uniqueidentifier,

	@TimeStamp timestamp output

AS

	INSERT INTO SecurityRoleAccess

	(SecurityRoleAccessId, [Role], SecurityRole, [Permissions], CreatedBy, CreatedOn, LastChanged, LastChangedBy)

	VALUES 

	(@SecurityRoleAccessId, @Role, @SecurityRole, @Permissions, @CreatedBy, @CreatedOn, @LastChanged, @LastChangedBy)

	SELECT @TimeStamp = [TimeStamp]

	FROM SecurityRoleAccess WHERE SecurityRoleAccessId = @SecurityRoleAccessId

RETURN 0